/*
	File:		Entity.h
	Course:		SGD 1303
	Author:		dmonroe
	Purpose:	CEntity class is the base class for game entities
*/


#pragma once

#include "IEntity.h"


//**************************************************
// CEntity class
//	- concrete base class implements all the pure virtual
//	  methods declared in the interface
//	- used for any moving object (player, computer, projectiles, power-ups)
class CEntity : public IEntity
{
public:
	//**********************************************
	CEntity( void );
	virtual ~CEntity( void );		// MUST BE VIRTUAL!

	
	//**********************************************
	// IEntity Interface:
	virtual	void Update( float fElapsedTime );
	virtual void Render( void );
	
	virtual RECT	GetRect( void ) const;
	virtual int		GetType( void ) const				{	return m_eType;		}
	virtual bool	CheckCollision( IEntity* pOther );
	
	// Reference Counting:
	virtual void AddRef	( void );
	virtual void Release( void );


	//**********************************************
	// Accessors:
	float	GetPosX		( void ) const	{	return	m_fPosX;	}
	float	GetPosY		( void ) const	{	return	m_fPosY;	}
	float	GetVelX		( void ) const	{	return	m_fVelX;	}
	float	GetVelY		( void ) const	{	return	m_fVelY;	}
	int		GetImageID	( void ) const	{	return	m_nImageID;	}
	int		GetWidth	( void ) const	{	return	m_nWidth;	}
	int		GetHeight	( void ) const	{	return	m_nHeight;	}

	// Mutators:
	void	SetPosX		( float	x	)	{	m_fPosX		=	x;	}
	void	SetPosY		( float	y	)	{	m_fPosY		=	y;	}
	void	SetVelX		( float	vx	)	{	m_fVelX		=	vx;	}
	void	SetVelY		( float	vy	)	{	m_fVelY		=	vy;	}
	void	SetImageID	( int	id	)	{	m_nImageID	=	id;	}
	void	SetWidth	( int	w   )	{	m_nWidth	=	w;	}
	void	SetHeight	( int	h   )	{	m_nHeight	=	h;	}

	
	//**********************************************
	// Attributes:

protected:
	// entity type
	enum	EntityType		{ ENT_BASE/*,*/ };
	EntityType			m_eType;

private:
	// position
	float			m_fPosX;
	float			m_fPosY;

	// velocity
	float			m_fVelX;
	float			m_fVelY;

	// image
	int				m_nImageID;

	// size
	int				m_nWidth;
	int				m_nHeight;

	// reference count
	unsigned int	m_unRefCount;
};

